﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObserverAndMediator
{
    /// <summary>
    /// 乞丐
    /// </summary>
    public class Beggar : EventCustomer
    {
        /// <summary>
        /// 只能處理被人遺棄的東西
        /// </summary>
        public Beggar() : base(EventCustomType.DEL)
        {

        }

        public override void exec(ProductEvent events)
        {
            //事件的源頭
            Product p = events.Source;
            //事件類型
            ProductEventType type = events.EventType;

            Console.WriteLine("乞丐處理事件：" + p.Name + " 銷毀，事件類型 = " + type);

        }
    }
}
